package com.yc.entities;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户主体账户信息表
 * </p>
 *
 * @author kuakha
 * @since 2021-04-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="BloodSugarUser对象", description="用户主体账户信息表")
public class BloodSugarUser extends Model<BloodSugarUser> {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "用户主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "用户账号")
    private String account;

    @ApiModelProperty(value = "用户密码 使用BCrypt加密方式")
    private String password;

    @ApiModelProperty(value = "用户账号是否禁用 0:启用  1:禁用")
    private String isDisable;

    @TableLogic
    @ApiModelProperty(value = "用户是否删除 0:未删除  1:已删除")
    private String isDelete;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "用户账号创建时间")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill =FieldFill.UPDATE)
    @ApiModelProperty(value = "用户账号更新时间")
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户角色关联信息")
    private List<BloodSugarUserRole> bloodSugarUserRoleList;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户名称")
    private String userName;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户登录Token")
    private String token;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户所属院长id")
    private Integer deanId;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户所属科室id")
    private Integer departmentId;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户账号类型")
    private String roleType;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
